﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Windows.Forms;
using Pasta.Medio.Concrete;
using Pasta.Medio.Configuration;
using Pasta.Medio.Domain;

namespace Pasta.Medio
{

	static class Program
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(string[] args)
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			Initialize();

			Application.Run(new MedioShell(args));
		}

		private static void Initialize()
		{
			// read settings from config file
			Settings = new AppSettings(Constants.Company, Constants.Product);

			// create the singleton context
			Context = new MedioEntities();

			// create singleton repositories
			Enums = new EnumsRepository();
			Recordings = new RecordingsRepository();

			Catalog = new SortableBindingList<Recording>(Program.Recordings.List());
		}

		public static AppSettings Settings { get; private set;  }
		public static MedioEntities Context { get; private set; }
		public static RecordingsRepository Recordings { get; private set; }
		public static EnumsRepository Enums { get; private set; }

		public static SortableBindingList<Recording> Catalog { get; private set; }

	}
}
